package com.example.wblog.util;

import com.example.wblog.model.User;
import org.springframework.stereotype.Component;

@Component
public class HostHolderUtil {
    ThreadLocal<User> users = new ThreadLocal<>();

    public void set(User user) {
        users.set(user);
    }

    public User get() {
        return users.get();
    }

    public void clear() {
        users.remove();
    }
}
